#!/bin/sh

# PGRFlyCapture and OpenCV, both compiled with Intel's Compiler,
# do not play nice with each other...
KMP_DUPLICATE_LIB_OK=TRUE
export $KMP_DUPLICATE_LIB_OK

# Required option for full-screen support under Mac OS X
OPTIONS=-Dapple.awt.fullscreencapturealldisplays=false

# Not all video drivers support OpenGL well, so we let it disabled
# by default, but you can try to enable it here to get lower latency.
#OPTIONS="-Dapple.awt.fullscreencapturealldisplays=false -Dsun.java2d.opengl=True"

java -d64 -server -version
if [ $? -eq 0 ]
then
java -d64 -server $OPTIONS -jar "`dirname "$0"`/modules/procamcalib.jar" --laf javax.swing.plaf.metal.MetalLookAndFeel "$@"
else
echo "WARNING: 64-bit server JVM not available. Executing with default JVM..."
java $OPTIONS -jar "`dirname "$0"`/modules/procamcalib.jar" --laf javax.swing.plaf.metal.MetalLookAndFeel "$@"
fi
